<template>
<el-form ref="Logrec" :model="Transport" label-width="150px">
  <el-form-item required label="经手人">
    <el-input type="textarea" v-model="Transport.handler" style="width:50%;float: left;"></el-input>
  </el-form-item>
  <el-form-item required label="收货人">
    <el-input required type="textarea" v-model="Transport.reciver" style="width:50%;float: left;"></el-input>
  </el-form-item>
  <el-form-item required label="登录状态">
    <el-select style="float: left;" v-model="Transport.transporttype" placeholder="请选择登录状态">
      <el-option label="发货中" value=1></el-option>
      <el-option label="送货中" value=2></el-option>
      <el-option label="已签收" value=3></el-option>
    </el-select>
  </el-form-item>
  <el-form-item>
    <el-button type="primary" @click="add">采集记录</el-button>
    <el-button>取消</el-button>
  </el-form-item>
</el-form>
</template>
<script>
import { addTrans,getLocaladdress } from '@/api'
  export default {
    data() {
      return {
        Transport: {
          handler: '',
          reciver: '',
          transporttype: null,
        }
      }
    },
    methods: {
      add(){
        addTrans(this.Transport).then((res) => {
            let _this = this;
            if(res){
                _this.$alert('采集成功！', '采集数据', {
                    confirmButtonText: '确定',
                    callback: action => {
                        //跳转
                        _this.$router.push('/translist/?id=' + _this.Transport.transporttype)
                    }
                });
            }else{
                this.$message({
                    showClose: true,
                    message: '采集失败！',
                    type: 'error'
                });
            }
        })
      }
    },
    created(){
    }
  }
</script>